Add a RESTful Web Service Data Source
To add a RESTful web service data source:
Choose New Data Source from the Project group of the Ribbon's Home tab. This will display a sub-menu of the different data source types.
Choose Standard Web Service.
The New Web Service dialog box will be displayed.
Enter a name for this Data Source in the Name field. This name is used to reference the Data Source within your Project.
Choose REST in the Service Type field. The remaining options will change according to your choice here.
Enter a URL for the awi web service location, such as http://myserver/webservice.asmx.
Enter a Username and Password, if required to allow App Server to impersonate a specific Windows user when using this web service. Note the password will be displayed as asterisks.
Select the type of content the web service will expect in the Content Type field.
Enter any parameters for this Web Service that you want to be able to map to Controls.
To enter a parameter, click on the Add button below the Parameters list. A new parameter will be added to the list and you can then edit the values for it by clicking in each table cell in turn that you want to edit.
Parameters can be either string values or xml. For xml parameters, you need to supply a schema describing the parameter in the final column of the Parameters list. Click in the final column and select the required schema from the drop-down list. If the schema isn't listed, you can add it in by clicking on the New Schema… button.
For each parameter you also need to specify a direction – select in if the value will come from the web service and out if the value will be sent out to the web service. You can only have ONE out parameter. You can also specify a default value for each parameter, in the Value field.
When you have finished, click on the OK button.
Your web Service will now be listed in the Data Sources Pane – click on the Data Sources tab to display this pane if it isn't already in view. A new window will also appear in the Workspace, showing a tree view of your web service's data types.
Clicking on a node in the tree view in the Data Sources Pane will display the Properties for that node in the Properties Pane. Editable Properties are displayed in black. Those which can't be edited are displayed in grey.
The following table lists some of the main Properties available for the different nodes:
Name
The name you have given to refer to this Data Source in your Project.
URL
Web Service URL.
Method
Http Method – POST or GET.
Content Type
Http Content type.
Schema
An XML file defining the data elements available for this web service.
Username and Password
Use to allow App Server to impersonate a specific Windows user. Note the password is displayed as asterisks.
For each Digitise app you publish to the App Server, there are a number of Properties relating to each Data Source which can be specified within App Manager. These Properties include the connection details and any username and password required to access the remote data source.
These Properties can be entered manually within App Manager or copied into App Manager, when the Project is published to the App Server, from the equivalent Properties specified within App Studio. Any values stored within App Manager will be used in preference to the values entered within App Studio. This allows you to modify some essential Properties for Data Sources without having to edit and republish your Project, e.g. to move temporarily from a live to a test data source. The Properties are specified within App Manager using the Data Sources button under the Properties tab for individual published apps.
The Overwrite Server Settings Property within App Studio allows you to specify whether you want the App Manager Data Source Properties to be overwritten by the equivalent values within a Project when you publish the Project to the App Server.
You specify a default value for this Property under the Project Properties but you can change this for each individual Data Source within the Project, if required.
Under the Project Properties, set this Property to True if you want the default action to be to overwrite the App Manager settings when you publish the Project or False if you want the default action to be not to overwrite them.
Under each individual Data Source, the default value for the Overwrite Server Settings Property is Default, which means it will use the value specified within the Project Properties. To use a different setting for an individual Data Source than the default setting, under the particular Data Source's Properties, change the Overwrite Server Settings Property's value from Default to True if you want the App Manager settings to be overwritten or False to retain the App Manager settings.
Device Database
Allows you to specify the local database on the mobile device in which you want your app to store data records for this Data Source. Leave at <default> if you want to use the default database to store this data.
Specify the name of the database file to use without the file extension. Note that for the Android, iOS and Windows Universal Platforms you cannot include a path with the file name.
You can share a database between different apps by prefixing the database name with %SHARE%\, e.g. %SHARE%\MyAppData.
Device Table
Name of the table in the local database on the mobile device to store data for this Data Source.
Timeout
Number of seconds the Digitise Apps Client will wait for data to start being downloaded when a data download is requested at runtime.
You can also change this value on the App Server, using the App Manager utility, allowing you to easily adjust the interval without having to change your app.
Storage Mode
Select Disk to retain data in the Client Database, Memory for temporary data. On the Android, iOS and Windows Universal Platforms data is always stored on 'disk'.
Modify Action Online
When the device can connect to the App Server, Direct means that a call will be made to synchronise data with the server when the data is updated on the mobile device; Local means that the data will be retained locally and a Script command used to synchronise with the server.
Modify Action Offline
Specifies what to do when the mobile device cannot connect to the App Server: Local will just store the data locally (as normal), the other options will display a warning or error.
This Property is not supported on Android, iOS or Windows Universal Platforms.
Sync Direction
This Property is not relevant when using RESTful Web Service Data Sources. It should be set to None.
Primary Key
Set this Property to True if this data item is the Primary Key or part of a combination of columns making up the Primary Key for this Data Source. The Primary Key must be a unique value for each record.
Otherwise it should be set to False.
Default
Default value for this data.
Length
Specifies the maximum number of characters for this data item. The default value of 0 indicates that the default length is to be used, which is 4000 characters.
Allow Null
If this data item can contain Null values, this Property should be set to True, otherwise it should be set to False.
The value of this Property should match the equivalent property for the relevant column in the remote Target data source otherwise you may get errors when uploading or downloading data to or from this data item.
SQL Type Override
Allows you to specify a SQL data type to be used for this data item in the local database on the mobile device instead of the default data type assigned when the Data Source was created.